package org.real.guetshop.controller.admin;

import io.swagger.v3.oas.annotations.Operation;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.real.guetshop.pojo.dto.OrderPageDTO;
import org.real.guetshop.result.PageResult;
import org.real.guetshop.result.Result;
import org.real.guetshop.service.OrderService;
import org.springframework.web.bind.annotation.*;


@RestController("adminOrderController")
@RequestMapping("/admin/order")
@Slf4j
public class OrderController {

    @Resource
    private OrderService orderService;

    @PostMapping("/page")
    @Operation(summary = "商家订单分页查询")
    public Result<PageResult> page(@RequestBody OrderPageDTO orderPageDTO) {
        log.info("商家订单分页查询：{}", orderPageDTO);
        PageResult pageResult = orderService.getPage(orderPageDTO);
        return Result.success(pageResult);
    }
}
